                                                                      Page 1
                                                              D:\TEMP\gh_000063c1.s
Command Line: E:\uti\compiler\GHS\comp_201517\ease850.exe -w -stderr=err/r_fcl_hw_access_asm.err -elf -b0 -I../../../bsw/_common -I../../../bsw/flash -I../../../bsw/flash/flashlib -Ie:/uti/compiler/ghs/comp_201517/ansi -Ie:/uti/compiler/ghs/comp_201517/include/v800 -Igendata -Iinclude -IE:\uti\compiler\GHS\comp_201517\lib\rh850 -cg_underscore -cpu=rh850g3m -no_v850_simd -rh850_fpsimd=none -dbo=D:\usr\usage\Delivery\CBD17x\CBD1700369\D04\external\BSW\Flash\build\obj\r_fcl_hw_access_asm.dbo -dwarf2 -source=../../../BSW/Flash/FlashLib/r_fcl_hw_access_asm.850 -o obj\gh_000063c1.o -list=lst/r_fcl_hw_access_asm.lst D:\TEMP\gh_000063c1.s 
Original File: D:\TEMP\gh_000063c1.s
Source File: ../../../BSW/Flash/FlashLib/r_fcl_hw_access_asm.850
Directory: D:\usr\usage\Delivery\CBD17x\CBD1700369\D04\external\BSW\Flash\build
Host OS: Windows 7 Service Pack 1
EASE: Copyright (C) 1983-2015 Green Hills Software.  All Rights Reserved.
Release: Compiler v2015.1.7
Build Directory: [Directory] BTOWORKER6:c:/build_2015_1_bto/2015-10-21.2100-2015_1_bto/win32-comp-ecom
Revision: [VCInfo] http://toolsvc/branches/release-branch-70-bto/src@544153 (built by build)
Revision Date: Thu Oct 22 07:50:13 2015

Release Date: Thu Oct 22 09:32:32 2015

                           0 #line 1 "../../../BSW/Flash/FlashLib/r_fcl_hw_access_asm.850"
                           1 --
                           2 -- Library       : Code Flash Access Library for Renesas RH850 devices, based on the RV40 Flash technology
                           3 --
                           4 -- File Name     : $Source: r_fcl_hw_access_asm.850 $
                           5 -- Lib. Version  : $RH850_FCL_LIB_VERSION_T01: V2.00 $
                           6 -- Mod. Revision : $Revision: 1.5 $
                           7 -- Mod. Date     : $Date: 2014/09/01 13:40:56MESZ $
                           8 -- Device(s)     : RV40 Flash based RH850 microcontroller
                           9 -- Description   : FCL hardware interface functions (assembler)
                          10 -------------------------------------------------------------------------------------------------------------
                          11 --
                          12 --   Purpose:
                          13 --      Assembler code of basic functions used during self-programming
                          14 --
                          15 --   Environment:
                          16 --      Devices: RV40F Flash based RH850 microcontroller
                          17 --      IDE's:   GHS      
                          18 --
                          19 -------------------------------------------------------------------------------------------------------------
                          20 --
                          21 -- DISCLAIMER
                          22 -- This software is supplied by Renesas Electronics Corporation and is only
                          23 -- intended for use with Renesas products. No other uses are authorized. This
                          24 -- software is owned by Renesas Electronics Corporation and is protected under
                          25 -- all applicable laws, including copyright laws.
                          26 -- THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
                          27 -- THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
                          28 -- LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
                          29 -- AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
                          30 -- TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
                          31 -- ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
                          32 -- FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
                          33 -- ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
                          34 -- BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
                          35 -- Renesas reserves the right, without notice, to make changes to this software
                          36 -- and to discontinue the availability of this software. By using this software,
                          37 -- you agree to the additional terms and conditions found by accessing the
                          38 -- following link:
                          39 -- http:
                          40 --
                          41 -- Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.
                          42 --
                          43 -------------------------------------------------------------------------------------------------------------
                          44 
                          45 
                          46 -------------------------------------------------------------------------------------------------------------
                          47 --Includes   <System Includes> , "Project Includes" 
                          48 -------------------------------------------------------------------------------------------------------------
                          49 

                                                                      Page 2
                                                              D:\TEMP\gh_000063c1.s
                          50 
                          51 -------------------------------------------------------------------------------------------------------------
                          52 --Macro definitions
                          53 -------------------------------------------------------------------------------------------------------------
                          54 
                          55 
                          56 
                          57 -------------------------------------------------------------------------------------------------------------
                          58 --Typedef definitions
                          59 -------------------------------------------------------------------------------------------------------------
                          60 
                          61 
                          62 -------------------------------------------------------------------------------------------------------------
                          63 --Exported global variables (to be accessed by other files) 
                          64 -------------------------------------------------------------------------------------------------------------
                          65 
                          66 
                          67 -------------------------------------------------------------------------------------------------------------
                          68 --Private global variables and functions 
                          69 -------------------------------------------------------------------------------------------------------------
                          70 
                          71 -------------------------------------------------------------------------------------------------------------
                          72 -- Function name: R_FCL_Fct_CodeRomRam_CalcRange
                          73 -------------------------------------------------------------------------------------------------------------
                          74 --
                          75 -- Function calculates start address and size of section R_FCL_CODE_ROMRAM
                          76 --
                          77 -- @param[out]    r6: secStart_u32   Start address of the section R_FCL_CODE_ROMRAM
                          78 --                r7: secSize_u32    Size of the section R_FCL_CODE_ROMRAM
                          79 -- @return        ---
                          80 --
                          81 -------------------------------------------------------------------------------------------------------------
                          82 .section".R_FCL_CODE_ROM",.text
                          83 .globl _R_FCL_Fct_CodeRomRam_CalcRange
                          84 
                          85 _R_FCL_Fct_CodeRomRam_CalcRange:
                          86      
00000000 20560000*        87     movea   lo(___ghsbegin_R_FCL_CODE_ROMRAM), zero, r10
00000004 4a560000*        88     movhi   hi(___ghsbegin_R_FCL_CODE_ROMRAM), r10, r10
                          89 
                          90      
00000008 205e0000*        91     movea   lo(___ghsend_R_FCL_CODE_ROMRAM), zero, r11
0000000c 4b5e0000*        92     movhi   hi(___ghsend_R_FCL_CODE_ROMRAM), r11, r11
                          93 
00000010 66570100         94     st.w    r10, 0[r6]
00000014 aa59             95     sub     r10, r11
00000016 675f0100         96     st.w    r11, 0[r7]
                          97 
0000001a 7f00             98     jmp     lp
                          99 
                         100 -------------------------------------------------------------------------------------------------------------
                         101 -- Function name: R_FCL_Fct_CodeRam_CalcRange
                         102 -------------------------------------------------------------------------------------------------------------
                         103 --
                         104 --  Function calculates start address and size of section R_FCL_CODE_RAM
                         105 --
                         106 --  @param[out]    r6: secStart_u32   Start address of the section R_FCL_CODE_RAM
                         107 --                 r7: secSize_u32    Size of the section R_FCL_CODE_RAM
                         108 --  @return        ---
                         109 --
                         110 -------------------------------------------------------------------------------------------------------------

                                                                      Page 3
                                                              D:\TEMP\gh_000063c1.s
                         111 .section".R_FCL_CODE_ROM",.text
                         112 .globl _R_FCL_Fct_CodeRam_CalcRange
                         113 
                         114 _R_FCL_Fct_CodeRam_CalcRange:
                         115      
0000001c 20560000*       116     movea   lo(___ghsbegin_R_FCL_CODE_RAM), zero, r10
00000020 4a560000*       117     movhi   hi(___ghsbegin_R_FCL_CODE_RAM), r10, r10
                         118 
                         119      
00000024 205e0000*       120     movea   lo(___ghsend_R_FCL_CODE_RAM), zero, r11
00000028 4b5e0000*       121     movhi   hi(___ghsend_R_FCL_CODE_RAM), r11, r11
                         122 
0000002c 66570100        123     st.w    r10, 0[r6]
00000030 aa59            124     sub     r10, r11
00000032 675f0100        125     st.w    r11, 0[r7]
                         126 
00000036 7f00            127     jmp     lp
                         128 
                         129 -------------------------------------------------------------------------------------------------------------
                         130 -- Function name: R_FCL_Fct_CodeUsr_CalcRange
                         131 -------------------------------------------------------------------------------------------------------------
                         132 --
                         133 --  Function calculates start address and size of section R_FCL_CODE_USR
                         134 --
                         135 --  @param[out]    r6: secStart_u32   Start address of the section R_FCL_CODE_USR
                         136 --                 r7: secSize_u32    Size of the section R_FCL_CODE_USR
                         137 --  @return        ---
                         138 --
                         139 -------------------------------------------------------------------------------------------------------------
                         140 .section".R_FCL_CODE_ROM",.text
                         141 .globl _R_FCL_Fct_CodeUsr_CalcRange
                         142 
                         143 _R_FCL_Fct_CodeUsr_CalcRange:
                         144      
00000038 20560000*       145     movea   lo(___ghsbegin_R_FCL_CODE_USR), zero, r10
0000003c 4a560000*       146     movhi   hi(___ghsbegin_R_FCL_CODE_USR), r10, r10
                         147 
                         148      
00000040 205e0000*       149     movea   lo(___ghsend_R_FCL_CODE_USR), zero, r11
00000044 4b5e0000*       150     movhi   hi(___ghsend_R_FCL_CODE_USR), r11, r11
                         151 
00000048 66570100        152     st.w    r10, 0[r6]
0000004c aa59            153     sub     r10, r11
0000004e 675f0100        154     st.w    r11, 0[r7]
                         155 
00000052 7f00            156     jmp     lp
                         157     
                         158 -------------------------------------------------------------------------------------------------------------
                         159 -- Function name: R_FCL_Fct_CodeUsrInt_CalcRange
                         160 -------------------------------------------------------------------------------------------------------------
                         161 --
                         162 --  Function calculates start address and size of section R_FCL_CODE_USRINT
                         163 --
                         164 --  @param[out]    r6: secStart_u32   Start address of the section R_FCL_CODE_USRINT
                         165 --                 r7: secSize_u32    Size of the section R_FCL_CODE_USRINT
                         166 --  @return        ---
                         167 --
                         168 -------------------------------------------------------------------------------------------------------------
                         169 .section".R_FCL_CODE_ROM",.text
                         170 .globl _R_FCL_Fct_CodeUsrInt_CalcRange
                         171 

                                                                      Page 4
                                                              D:\TEMP\gh_000063c1.s
                         172 _R_FCL_Fct_CodeUsrInt_CalcRange:
                         173      
00000054 20560000*       174     movea   lo(___ghsbegin_R_FCL_CODE_USRINT), zero, r10
00000058 4a560000*       175     movhi   hi(___ghsbegin_R_FCL_CODE_USRINT), r10, r10
                         176 
                         177      
0000005c 205e0000*       178     movea   lo(___ghsend_R_FCL_CODE_USRINT), zero, r11
00000060 4b5e0000*       179     movhi   hi(___ghsend_R_FCL_CODE_USRINT), r11, r11
                         180 
00000064 66570100        181     st.w    r10, 0[r6]
00000068 aa59            182     sub     r10, r11
0000006a 675f0100        183     st.w    r11, 0[r7]
                         184 
0000006e 7f00            185     jmp     lp
                         186     
                         187 -------------------------------------------------------------------------------------------------------------
                         188 -- Function name: R_FCL_Fct_CodeExProt_CalcRange
                         189 -------------------------------------------------------------------------------------------------------------
                         190 --
                         191 --  Function calculates start address and size of section R_FCL_CODE_RAM_EX_PROT
                         192 --
                         193 --  @param[out]    r6: secStart_u32   Start address of the section R_FCL_CODE_RAM_EX_PROT
                         194 --                 r7: secSize_u32    Size of the section R_FCL_CODE_RAM_EX_PROT
                         195 --  @return        ---
                         196 --
                         197 -------------------------------------------------------------------------------------------------------------
                         198 .section".R_FCL_CODE_ROM",.text
                         199 .globl _R_FCL_Fct_CodeExProt_CalcRange
                         200 
                         201 _R_FCL_Fct_CodeExProt_CalcRange:
                         202      
00000070 20560000*       203     movea   lo(___ghsbegin_R_FCL_CODE_RAM_EX_PROT), zero, r10
00000074 4a560000*       204     movhi   hi(___ghsbegin_R_FCL_CODE_RAM_EX_PROT), r10, r10
                         205 
                         206      
00000078 205e0000*       207     movea   lo(___ghsend_R_FCL_CODE_RAM_EX_PROT), zero, r11
0000007c 4b5e0000*       208     movhi   hi(___ghsend_R_FCL_CODE_RAM_EX_PROT), r11, r11
                         209 
00000080 66570100        210     st.w    r10, 0[r6]
00000084 aa59            211     sub     r10, r11
00000086 675f0100        212     st.w    r11, 0[r7]
                         213 
0000008a 7f00            214     jmp     lp
                         215 
                         216 -------------------------------------------------------------------------------------------------------------
                         217 -- Function name: R_FCL_Fct_PrgOffset
                         218 -------------------------------------------------------------------------------------------------------------
                         219 --
                         220 --  Function calculates the offset between function execution address and link address
                         221 --
                         222 --  @param[in,out] ---
                         223 --  @return        Execution offset in Bytes
                         224 --
                         225 -------------------------------------------------------------------------------------------------------------
                         226 .section".R_FCL_CODE_ROM",.text
                         227 .globl _R_FCL_Fct_PrgOffset
                         228 
                         229 _R_FCL_Fct_PrgOffset:
                         230     jarl    L0, r10
                         230 <EXPANSION BEGIN>
                         230 jarl22 L0 , r10 

                                                                      Page 5
                                                              D:\TEMP\gh_000063c1.s
0000008c 80570400*       230 <EXPANSION END>
00000090 20360000*       231 L0: movea   lo(L0), zero, r6
00000094 46360000*       232     movhi   hi(L0), r6, r6
00000098 a651            233     sub     r6, r10
                         234 
0000009a 7f00            235     jmp     lp
                         236 
                         237 -------------------------------------------------------------------------------------------------------------
                         238 -- Function name: R_FCL_FCUFct_Switch_BFlash
                         239 -------------------------------------------------------------------------------------------------------------
                         240 --
                         241 -- Function enables or disables BFlash
                         242 --
                         243 -- @param[in]     r6: 1: Activate BFlash
                         244 --                r6: 0: Deactivate BFlash
                         245 -- @return        ---
                         246 --
                         247 -------------------------------------------------------------------------------------------------------------
                         248 .section".R_FCL_CODE_RAM",.text
                         249 .globl _R_FCL_FCUFct_Switch_BFlash
                         250 
                         251 _R_FCL_FCUFct_Switch_BFlash:
                         252     --  
00000000 2a060890c5ff    253     mov     0xffc59008uL, r10
00000006 4a370000        254     st.b    r6, 0[r10]
0000000a 0a570000        255     ld.b    0[r10], r10             --  
0000000e 1c00            256     synci                           --  
                         257 
00000010 7f00            258     jmp     lp
                         259     
                         260 -------------------------------------------------------------------------------------------------------------
                         261 -- Function name: R_FCL_FCUFct_Clear_Cache
                         262 -------------------------------------------------------------------------------------------------------------
                         263 --
                         264 -- Function clears the Flash cache
                         265 --
                         266 -- @param[in,out] ---
                         267 -- @return        ---
                         268 --
                         269 -------------------------------------------------------------------------------------------------------------
                         270 .section".R_FCL_CODE_RAM",.text
                         271 .globl _R_FCL_FCUFct_Clear_Cache
                         272 
                         273 _R_FCL_FCUFct_Clear_Cache:    
                         274      
00000012 f8674020        275     stsr    24, r12, 4              --  
00000016 8c660001        276     ori     0x0100, r12, r12
0000001a ecc72020        277     ldsr    r12, 24, 4
                         278 
                         279 _POLLING_SYSTEM_REG_:
0000001e f8674020        280     stsr    24, r12, 4              --  
00000022 cc660001        281     andi    0x0100, r12, r12
00000026 6062            282     cmp     0x0000, r12
00000028 bafd*           283     bne     _POLLING_SYSTEM_REG_
0000002a 1c00            284     synci                           --  
                         285 
                         286     --  
0000002c e6674008        287     stsr    6, r12, 1               --  
00000030 cc66e000        288     andi    0x00e0, r12, r12        --  
                         289     mov     0x20, r14
                         289 <EXPANSION BEGIN>

                                                                      Page 6
                                                              D:\TEMP\gh_000063c1.s
                         289 movea 0x20 , r0, r14 
00000034 20762000        289 <EXPANSION END>
00000038 ec71            290     cmp     r12, r14
0000003a a20d*           291     bz     _CLEAR_BWC_BUFFER_
                         292 
                         293      
0000003c f8674068        294     stsr    24, r12, 13             --  
00000040 8c660200        295     ori     0x0002, r12, r12
00000044 ecc72068        296     ldsr    r12, 24, 13
00000048 f8674068        297     stsr    24, r12, 13             --  
0000004c e50d*           298     br      _CLEAR_CACHE_END_
                         299 
                         300 _CLEAR_BWC_BUFFER_:
                         301      
0000004e 2c060007bcff    302     mov     0xffbc0700uL, r12
00000054 0172            303     mov     0x01, r14
00000056 4c070000        304     st.b    r0, 0[r12]       
0000005a 4c770000        305     st.b    r14, 0[r12]      
0000005e 4c070000        306     st.b    r0, 0[r12]       
00000062 0c770000        307     ld.b    0[r12], r14
00000066 1c00            308     synci
                         309 
                         310 _CLEAR_CACHE_END_:
                         311 
00000068 7f00            312     jmp     lp
                         313 
                         314 -------------------------------------------------------------------------------------------------------------
                         315 -- Function name: R_FCL_Fct_Copy_Code
                         316 -------------------------------------------------------------------------------------------------------------
                         317 --
                         318 -- Function calculates start address and size of section R_FCL_CODE_RAM.
                         319 --
                         320 -- @param[out]    r6: src_u32        start address
                         321 --                r7: dest_u32       destination address
                         322 --                r8: cnt_u32        size to copy (need to be 4 byte aligned)
                         323 -- @return        last destination address + 4
                         324 --
                         325 -------------------------------------------------------------------------------------------------------------
                         326 .section".R_FCL_CODE_RAM",.text
                         327 .globl _R_FCL_Fct_Copy_Code
                         328 
                         329 _R_FCL_Fct_Copy_Code:
0000006a e041            330     cmp     r0, r8
0000006c 920d*           331     be      _COPY_LOOP_END_
                         332 _COPY_LOOP_:   
0000006e 26570100        333     ld.w    0[r6], r10
00000072 67570100        334     st.w    r10, 0[r7]
00000076 4432            335     add     4, r6     
00000078 443a            336     add     4, r7
0000007a 5c42            337     add     -4, r8
0000007c 9afd*           338     bnz     _COPY_LOOP_
                         339 _COPY_LOOP_END_:   
0000007e 0750            340     mov     r7, r10
                         341 
00000080 7f00            342     jmp     lp
